//
//  loginView.m
//  SELF 豆瓣
//
//  Created by dllo on 15/11/7.
//  Copyright (c) 2015年 蓝鸥科技. All rights reserved.
//

#import "loginView.h"
@interface loginView()

@end
@implementation loginView
-(instancetype)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame]) {
        
        [self createSubViews];
    }
    return self;
    
    
}

-(void)createSubViews
{
    
    //铺设用户名label
    self.nameLabel = [[UILabel alloc]initWithFrame:CGRectMake(20, 100, 65, 20)];
    [self addSubview:self.nameLabel];
    self.nameLabel.text = @"用户名:";
    //    self.nameLabel.backgroundColor = [UIColor redColor];
    [_nameLabel release];
    
    
    //铺设密码label
    self.passWorldLabel = [[UILabel alloc]initWithFrame:CGRectMake(self.nameLabel.frame.origin.x, self.nameLabel.frame.origin.y+50, 62, 20)];
    [self addSubview:self.passWorldLabel];
    self.passWorldLabel.text = @"密码:";
    //    self.passWorldLabel.backgroundColor = [UIColor redColor];
    [_passWorldLabel release];
    
    
    //铺设用户名输入
    self.loginText = [[UITextField alloc]initWithFrame:CGRectMake(self.nameLabel.frame.origin.x+150, self.nameLabel.frame.origin.y, 140, 20)];
    [self addSubview:self.loginText];
    self.loginText.placeholder = @"请输入用户名";
    [_loginText release];
    
    
    //铺设密码输入
    self.passWordText = [[UITextField alloc]initWithFrame:CGRectMake(self.loginText.frame.origin.x, self.passWorldLabel.frame.origin.y, 140, 20)];
    [self addSubview:self.passWordText];
    self.passWordText.placeholder = @"请输入密码";
    [_passWordText release];
    
    
    //铺设登录按钮
    self.loginBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    self.loginBtn.frame = CGRectMake(self.nameLabel.frame.origin.x, self.passWorldLabel.frame.origin.y+70, 100, 35);
    [self addSubview:self.loginBtn];
    [self.loginBtn setTitle:@"登录" forState:UIControlStateNormal];
    self.loginBtn.backgroundColor = [UIColor colorWithRed:0.604 green:0.765 blue:0.239 alpha:1.000];
    //    self.loginBtn.selected = NO;
    
    
    //铺设注册按钮
    self.zhuCeBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    self.zhuCeBtn.frame = CGRectMake(self.loginBtn.frame.origin.x+200, self.loginBtn.frame.origin.y, 100, 35);
    [self addSubview:self.zhuCeBtn];
    
    
    
    
    [self.zhuCeBtn setTitle:@"注册" forState:UIControlStateNormal];
    self.zhuCeBtn.backgroundColor = [UIColor colorWithRed:0.847 green:0.494 blue:0.145 alpha:1.000];
    [self.zhuCeBtn addTarget:self action:@selector(zhuceBtn:) forControlEvents:UIControlEventTouchUpInside];
    
    
}



//注册按钮事件
-(void)zhuceBtn:(UIButton *)btn
{
    
    [self.zhuCeDelegate pushZhuCe];
    
    
    
}

@end
